using System;
using NUnit.Framework;
using NUnit.Framework.Constraints;

namespace NetworkFileShare.Test.EndToEnd {

    class AssertProbe {

        readonly int delayInMs;
        readonly int pollingInMs;

        public AssertProbe(int delay, int polling) {
            delayInMs = delay;
            pollingInMs = polling;
        }

        public void AssertThat(ActualValueDelegate actualValueDelegate, Constraint constraint, string message) {
            Assert.That(actualValueDelegate, Delayed(constraint), message);
        }

        public void AssertThat(ActualValueDelegate actualValueDelegate, Constraint constraint) {
            Assert.That(actualValueDelegate, Delayed(constraint));
        }

        DelayedConstraint Delayed(Constraint constraint) {
            return constraint.After(delayInMs, pollingInMs);
        }
    }

}